package com.lanchetech.merchant.controller;

import com.lanchetech.bean.request.LotteryOrderReq;
import com.lanchetech.bean.response.BaseResp;
import com.lanchetech.bean.response.LotteryOrderResp;
import com.lanchetech.bean.response.ResultData;
import com.lanchetech.entity.LotteryOrder;
import com.lanchetech.merchant.service.LotteryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "抽奖API", tags = "抽奖API")
@RequestMapping("/api/lottery")
@RestController
public class LotteryController {

    @Autowired
    private LotteryService lotteryService;

    @ApiOperation("抽奖订单列表")
    @GetMapping("/getInvoiceApplyDetail")
    public ResultData queryLotteryOrder(LotteryOrderReq lotteryOrderReq){
        return lotteryService.queryLotteryOrder(lotteryOrderReq);
    }


    @ApiOperation("编辑抽奖订单")
    @PostMapping("/editOrder")
    public BaseResp editOrder(@RequestBody LotteryOrder order){
        return lotteryService.editOrder(order);
    }


    @ApiOperation(value = "抽奖订单详情", notes = "抽奖订单详情")
    @GetMapping("/getLotteryOrderDetail")
    public ResultData<LotteryOrderResp> getLotteryOrderDetail(Long id){
        return lotteryService.getLotteryOrderDetail(id);
    }
}
